home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
dev
/
gcc
/
ixemul_src.lha
/
ixemul-41.0
/
library
/
ixconfig.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-17
|
6KB
|
199 lines
/*
* This file is part of ixemul.library for the Amiga.
* Copyright (C) 1991, 1992 Markus M. Wild
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* NOT (!) to be used by custom applications, this is a very special case !! */
#include "ixemul.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
extern struct ixemul_base *ixemulbase;
int
main (int argc, char *argv[])
{
int c;
int do_dots = ixemulbase->ix_translate_dots;
int do_slash = ixemulbase->ix_translate_slash;
int mem_buf = ixemulbase->ix_membuf_limit;
int do_force = ixemulbase->ix_force_translation;
int do_links = ixemulbase->ix_translate_symlinks;
int do_sleep = 0;
int red_zone_size = ixemulbase->ix_red_zone_size;
int do_watch = ixemulbase->ix_watch_stack;
int fs_buf_factor = ixemulbase->ix_fs_buf_factor;
int ignore_global_env = ixemulbase->ix_ignore_global_env;
int no_ces_then_open_console = ixemulbase->ix_no_ces_then_open_console;
int unix_pattern_matching = ixemulbase->ix_unix_pattern_matching;
int unix_pattern_matching_case_sensitive = ixemulbase->ix_unix_pattern_matching_case_sensitive;
int no_insert_disk_requester = ixemulbase->ix_no_insert_disk_requester;
while ((c = getopt (argc, argv, "./?ab:cdefhilm:pPr:svwx")) != EOF)
switch (c)
{
case 'd':
mem_buf = 0;
/* fall into */
case 'a':
do_dots =
do_slash =
do_force =
do_links = 0;
break;
case 'b':
fs_buf_factor = atoi (optarg);
if (! fs_buf_factor)
fs_buf_factor = 64;
break;
case 'c':
no_ces_then_open_console = 1;
break;
case 'v':
no_insert_disk_requester = 1;
break;
case 'p':
unix_pattern_matching = 1;
unix_pattern_matching_case_sensitive = 0;
break;
case 'P':
unix_pattern_matching = 1;
unix_pattern_matching_case_sensitive = 1;
break;
case '.':
do_dots = 1;
break;
case '/':
do_slash = 1;
break;
case 'f':
do_force = 1;
break;
case 'i':
ignore_global_env = 1;
break;
case 'e':
ignore_global_env = 0;
break;
case 'l':
do_links = 1;
break;
case 'm':
mem_buf = atoi (optarg);
break;
case 'r':
red_zone_size = atoi (optarg);
break;
case 's':
do_sleep = 1;
break;
case 'w':
do_watch = 1;
break;
case 'x':
do_watch = 0;
break;
default:
fprintf (stderr, "%s [-d|-a|-c|-p|-P|-b N|-f|-i|-e|-.|-/|-l|-m N|-r N|-s|-w|-x]\n", argv[0]);
fprintf (stderr, " -d reset values to defaults\n"
" -a full AmigaDOS mode, no ./ translations\n"
" -c open console if no errorstream was provided\n"
" -p use UNIX-style filename pattern-matching\n"
" -P use case-sensitive UNIX-style filename pattern-matching\n"
" -b N N physical block map into 1 logical (stdio) block\n"
" -f don't accept AmigaDOS notation\n"
" -i ignore global environment (ENV:)\n"
" -e don't ignore global environment (ENV:)\n"
" -. translate . and ..\n"
" -/ translate /foo -> foo: and a//b -> a/b\n"
" -l translate contents of symbolic links\n"
" -m N files upto N bytes are cached in memory\n"
" -r N set red zone size to N bytes. 0 disables.\n"
" -s sleep, don't return.\n"
" -v suppress the \"Insert volume in drive\" requester\n"
" -w enable stack watcher\n"
" -x disable stack watcher\n");
exit (1);
}
ixemulbase->ix_translate_dots = do_dots;
ixemulbase->ix_translate_slash = do_slash;
ixemulbase->ix_translate_symlinks = do_links;
ixemulbase->ix_force_translation = do_force;
ixemulbase->ix_membuf_limit = mem_buf;
ixemulbase->ix_red_zone_size = red_zone_size;
ixemulbase->ix_watch_stack = do_watch;
ixemulbase->ix_fs_buf_factor = fs_buf_factor;
ixemulbase->ix_ignore_global_env = ignore_global_env;
ixemulbase->ix_no_ces_then_open_console = no_ces_then_open_console;
ixemulbase->ix_unix_pattern_matching = unix_pattern_matching;
ixemulbase->ix_unix_pattern_matching_case_sensitive = unix_pattern_matching_case_sensitive;
ixemulbase->ix_no_insert_disk_requester = no_insert_disk_requester;
printf ("%sranslate . and .., %stranslate /, %stranslate symlinks,\n"
"%sallow AmigaDOS notation, membuf size = %d,\n"
"red zone size = %d, stack watcher is %s %s,\n"
"%d physical blocks build%s one logical block (for stdio),\n"
"%signore global environment (ENV:),\n"
"%sse UNIX-style pattern-matching (case-%ssensitive),\n"
"%ssuppress the \"Insert volume in drive\" requester,\n"
"%sopen console if no errorstream was provided.\n",
do_dots ? "T" : "Don't t",
do_slash ? "" : "don't ",
do_links ? "" : "don't ",
do_force ? "don't " : "",
mem_buf,
red_zone_size,
do_watch ? "enabled" : "disabled",
red_zone_size ? (do_watch ? "(and active)" : "(and not active)")
: (do_watch ? "(but not active)" : "(and not active)"),
fs_buf_factor, fs_buf_factor == 1 ? "s" : "",
ignore_global_env ? "" : "don't ",
unix_pattern_matching ? "u" : "don't u",
unix_pattern_matching_case_sensitive ? "" : "in",
no_insert_disk_requester ? "" : "do not ",
no_ces_then_open_console ? "" : "don't ");
/* if -s is specified, the program keeps the library open until it is
interrupted. That way, the library can't be flushed, so the preferences
are not reset */
if (do_sleep)
pause ();
return 0;
}